package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.other.DishFlavor;
import com.example.mapper.other.DishFlavorMapper;
import com.example.service.DishFlavorSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class DishFlavorServiceImpl extends ServiceImpl<DishFlavorMapper, DishFlavor> implements DishFlavorSerivce {
    @Autowired
    private DishFlavorMapper dishFlavorMapper;

    @Override
    public boolean removeByDishId(List<Long> list) {
        LambdaQueryWrapper<DishFlavor> queryWrapper = new LambdaQueryWrapper<>();
        for(Long id:list){
            queryWrapper.eq(DishFlavor::getDishId,id);
            int delete = dishFlavorMapper.delete(queryWrapper);
        }
        return true;
    }
}
